<template>
    <div v-if="tkIsShow">
        <div class="zhezhao"></div>
        <div class="tankuang">
            <div class="tk_title">{{ title }}</div>
            <img src="../../assets/icon-close.png" class="tk_close" @click="closeTk">
            <div class="tk_content">
              <div class="table_box">
                <el-table
                    :data="tableData"
                    stripe
                    style="width: 100%">
                    <el-table-column
                    prop="createTime"
                    label="时间"
                    width="200"
                    align="center">
                    </el-table-column>
                    <el-table-column
                    prop="point"
                    label="积分数量"
                    width="200"
                    align="center">
                    </el-table-column>
                    <el-table-column
                    prop="money"
                    label="充值金额"
                    width="120"
                    align="center">
                    </el-table-column>
                    <el-table-column
                    label="充值渠道"
                    width="200"
                    align="center">
                    <template slot-scope="scope">
                        {{ scope.row.type===1?'后台管理员充值':'前端充值' }}
                    </template>
                    </el-table-column>
                </el-table>
                <pagination
                :total="total"
                :limit="pageSize"
                :page="pageNumber"
                :pageSize="pageSize"
                @pageChange="pageChange"
                ></pagination>
              </div>
            </div>
        </div>
    </div>
</template>
<script>
import Pagination from "@/components/pagination.vue";
export default {
  components: {
    Pagination
  },
  data() {
    return {
        tkIsShow:false,
        title:"",
        uuid:0,
        type:0,
        total: 0,
        pageSize: 30,
        pageNumber: 1,
        tableData:[]
    };
  },
  methods: {
    __init(uuid,type) { 
        this.uuid=uuid;
        this.type=type;
        this.getDataList();
    },
    getDataList(){
      var url="manager/getUsersLogsByPage";
      var params={
        uuid:this.uuid,
        type:this.type,
        pageSize: this.pageSize,
        pageNum: this.pageNumber,
      }
      this.$post(url, params).then((res) => {
        console.log(res)
        if (res.code === 200) {
            this.tableData=res.data.list;
            this.total=res.data.total;
        } else {
          this.$message.error(res.msg)
        }
      });
    },
    closeTk(){
        this.tkIsShow = false;
    },
    pageChange(e) {
      this.pageNumber = e.page;
      this.getDataList();
    }
  }
}
</script>
<style scoped lang="scss">
  .zhezhao{
    position: fixed;
    width: 100%;
    height: 100%;
    background-color: #000;
    opacity: 0.6;
    top: 0;
    left: 0;
    z-index: 200;
  }
  .tankuang{
    position: fixed;
    width: calc(100% - 240px);
    background-color: #fff;
    top: 50px;
    left: 220px;
    z-index: 201;
    border-radius: 5px;
    height: calc(100% - 70px);
  }
  .tk_title{
    font-size: 17px;
    height: 25px;
    line-height: 25px;
    margin: 15px 0;
  }
  .tk_content{
    width: 100%;
    height: calc(100% - 100px);
    overflow-y: auto;
    &::-webkit-scrollbar {
        width: 8px; /* 设置滚动条宽度为8像素 */
        background-color: transparent;
      }
      /* 滑块样式 */
      &::-webkit-scrollbar-thumb {
        background-color: #1e4dc6; /* 设置滑块颜色为深灰色 */
        border-radius: 4px; /* 设置滑块边角半径为4像素 */
      }
      /* 滚动条轨道内部空白区域样式 */
      &::-webkit-scrollbar-track {
        background-color: #fff /* 设置轨道背景色为浅灰色 */
      }

      /* 滚动条两端按钮样式 */
      &::-webkit-scrollbar-button {
        display: none; /* 不显示按钮 */
      }

      /* 交叉点处的区域样式 */
      &::-webkit-scrollbar-corner {
        background-color: transparent; /* 设置交叉点处的背景色为透明 */
      }

      /* 调整大小手柄样式 */
      &::-webkit-resizer {
        display: none; /* 不显示调整大小手柄 */
      }
  }
  
  .tk_close{
    position: absolute;
    width: 16px;
    height: 16px;
    top: 18px;
    right: 20px;
  }
  .table_box{
    padding: 0 2%;
  }
</style>
